package com.example.controller;


import com.example.common.result.Result;
import com.example.entity.dto.User.GetLoginUserByDeptNoDto;
import com.example.entity.vo.User.GetLoginUserByDeptNoVo;
import com.example.mapper.DscmaMapper;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author LiangPandeng
 * @since 2024-03-04
 */
@RestController
@RequestMapping("/api/dscma")
public class DscmaController {

    @Autowired
    private DscmaMapper dscmaMapper;

    @PostMapping("/getLoginUserByDeptNo")
    @ApiOperation("根据部门获取员工列表")
    public Result<List<GetLoginUserByDeptNoVo>> getLoginUserByDeptNo(@RequestBody GetLoginUserByDeptNoDto dto){
        List<GetLoginUserByDeptNoVo> list = dscmaMapper.getLoginUserByDeptNo(dto);
        return Result.success(list);
    }

}
